package com.app.xinfadi.util;

import android.annotation.SuppressLint;
import android.content.Context;
import android.view.View;

/**
 * 吐丝工具类 防止吐丝延迟跳出
 *
 * @author WuTengFei
 */
public class Toast {
    public static final int LENGTH_SHORT = 0;
    public static final int LENGTH_LONG = 1;
    private static android.widget.Toast mToast = null;

    @SuppressLint("ShowToast")
    public static android.widget.Toast makeText(Context context, String text, int duration) {
        if (mToast == null) {
            mToast = android.widget.Toast.makeText(context, text, duration);
        } else {
            mToast.setText(text);
            mToast.setDuration(duration);
        }
        return mToast;
    }


    public void snackBar(View layoutRoot) {


//        Snackbar.make(layoutRoot, "Hello SnackBar!", Snackbar.LENGTH_SHORT)
//                .
//
//                        setAction("Undo", new View.OnClickListener() {
//                                    @Override
//                                    public void onClick(View v) {
//                                        // Perform anything for the action selected
//                                    }
//                                }
//
//                        ).
//
//                show();
    }

}
